import request from '@/utils/request'

// 查询商品信息管理列表
export function listGoods(query) {
  return request({
    url: '/ruoyi-goods/goods/list',
    method: 'post',
    data: query
  })
}

// 查询商品信息管理详细
export function getGoods(id) {
  return request({
    url: '/ruoyi-goods/goods/' + id,
    method: 'get'
  })
}

// 新增商品信息管理
export function addGoods(data) {
  return request({
    url: '/ruoyi-goods/goods/add',
    method: 'post',
    data: data
  })
}

// 修改商品信息管理
export function updateGoods(data) {
  return request({
    url: '/ruoyi-goods/goods',
    method: 'put',
    data: data
  })
}

// 删除商品信息管理
export function delGoods(id) {
  return request({
    url: '/ruoyi-goods/goods/' + id,
    method: 'delete'
  })
}
export function delSpecification(id) {
  return request({
    url: '/ruoyi-goods/goods/specification/' + id,
    method: 'delete'
  })
}

// 通过仓库编号查找仓库名称
export function getWarehouseNameByWarehouseCode(warehouseCode) {
  return request({
    url: '/ruoyi-goods/goods/' + warehouseCode,
    method: 'get'
  })
}
// 得到仓库名称列表
  export function getWarehouseList() {
    return request({
      url: '/ruoyi-goods/goods/getWarehouseList',
      method: 'get'
    })
  }
  //得到最大商品代码
export function getMaxCode(){
  return request({
    url: '/ruoyi-goods/goods/getMaxGoodsCode',
    method: 'get'
  })
}
